package com.rest.api;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

import javax.ws.rs.POST;
import javax.ws.rs.Path;

import org.springframework.stereotype.Component;

@Component
@Path("/files")
public class FileApi {

	@Path("")
	@POST
	public File postFile(final File f) throws IOException {
		try (BufferedReader br = new BufferedReader(new FileReader(f))) {
			String s;
			do {
				s = br.readLine();
				System.out.println(s);
			} while (s != null);
			return f;
		}
	}
}
